import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/components/MyLogin.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/login'
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/home',
    name: 'home',
    component: () => import( '@/components/MyHome.vue'),
    children:[
      {path:'/welcome',component: () => import( '@/components/index/WelcomePage.vue')},
      {path:'/userlist',component: () => import( '@/components/user/UserList.vue')},
      {path:'/deliver',component: () => import( '@/components/news/DeliveryInfo')},
      {path:'/deliver/:id',component: () => import( '@/components/news/DeliveryInfo'),props:true},
      {path:'/newslist',component: () => import( '@/components/news/NewsList.vue')},
      {path:'/tongjiliebiao',component: () => import( '@/components/tongji/TongJi.vue')},
      {path:'/about',component: () => import( '@/components/system/AboutPage.vue')},
      {path:'/roles',component: () => import( '@/components/system/RolesPage.vue')},
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
